import json
import markdown_to_json

with open(r'.\test.md', 'r', encoding='utf8') as f:
    value = f.read()

dictified = markdown_to_json.dictify(value)
print(dictified)
jsonified = markdown_to_json.jsonify(value)
json_ = json.loads(jsonified)
print(json_)

def initCSV(fileName):
    """
    初始化csv文件
    :param fileName:
    :return:
    """
    title1 = ['发布时间', '岗位名称', '企业名称', '区域', '薪资', '学历', '工作经验', '招聘人数', '详情页url']
    filePath = '%s/%s.csv'%(dir, fileName)
    file1 = open(filePath, 'w', newline='', encoding='utf8')  # 打开文件
    content1 = csv.writer(file1, dialect='excel')  # 设定文件写入模式
    content1.writerow(title1)
    file1.close()
    return filePath

def writeCSV(rowData, path):
    """保存数据"""
    file1 = open(path, 'a', newline='')  # 打开文件
    content1 = csv.writer(file1, dialect='excel')  # 设定文件写入模式
    content1.writerow(rowData)
    file1.close()